/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.MailboxManager;
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class ModifySavedSearch
/*    */   extends RedoableOp
/*    */ {
/*    */   private int mSearchId;
/*    */   private String mQuery;
/*    */   private String mTypes;
/*    */   private String mSort;
/*    */   
/*    */   public ModifySavedSearch()
/*    */   {
/* 39 */     super(MailboxOperation.ModifySavedSearch);
/* 40 */     this.mSearchId = 0;
/*    */   }
/*    */   
/*    */   public ModifySavedSearch(int mailboxId, int searchId, String query, String types, String sort) {
/* 44 */     this();
/* 45 */     setMailboxId(mailboxId);
/* 46 */     this.mSearchId = searchId;
/* 47 */     this.mQuery = (query != null ? query : "");
/* 48 */     this.mTypes = (types != null ? types : "");
/* 49 */     this.mSort = (sort != null ? sort : "");
/*    */   }
/*    */   
/*    */   protected String getPrintableData() {
/* 53 */     StringBuffer sb = new StringBuffer("id=");
/* 54 */     sb.append(this.mSearchId).append(", query=").append(this.mQuery);
/* 55 */     sb.append(", types=").append(this.mTypes).append(", sort=").append(this.mSort);
/* 56 */     return sb.toString();
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException {
/* 60 */     out.writeInt(this.mSearchId);
/* 61 */     out.writeUTF(this.mQuery);
/* 62 */     out.writeUTF(this.mTypes);
/* 63 */     out.writeUTF(this.mSort);
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException {
/* 67 */     this.mSearchId = in.readInt();
/* 68 */     this.mQuery = in.readUTF();
/* 69 */     this.mTypes = in.readUTF();
/* 70 */     this.mSort = in.readUTF();
/*    */   }
/*    */   
/*    */   public void redo() throws Exception {
/* 74 */     Mailbox mailbox = MailboxManager.getInstance().getMailboxById(getMailboxId());
/* 75 */     mailbox.modifySearchFolder(getOperationContext(), this.mSearchId, this.mQuery, this.mTypes, this.mSort);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/ModifySavedSearch.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */